package com.ease.map.task.query {
    import com.ease.map.Map;
    import com.ease.map.feature.Feature;
    import com.ease.map.geometry.*;
    import com.ease.map.geometry.basetype.Extent;
    import com.ease.map.layer.FeatureLayer;
    import com.ease.map.layer.LayerData;

    import mx.rpc.events.FaultEvent;
    import com.ease.map.task.query.IQuery;

    /**
     * 查询
     * 通过远程调用查询
     */
    public class Query implements IQuery {
        protected var operationName:String;
        public var onResult:Function = null;
        public var onFault:Function = null;

        public function Query(operationName:String) {
            this.operationName = operationName;
            //不加这几句，类型反射会有问题，部分类型识别不出来
            var tmp:Object = null;
            tmp is AreaComposeGeometry;
            tmp is PolylineGeometry;
            tmp is PolygonGeometry;
            tmp is PointGeometry;
            tmp is ArcGeometry;
            tmp is CircleGeometry;
            tmp is EllipseGeometry;
            tmp is LineComposeGeometry;
        }

        /**
         * @param onResult 远程调用执行成功的回调函数
         * @param onFault 远程调用执行失败的回调函数
         */
        public function execute():void {
            return;
        }

        protected function onQueryFault(event:FaultEvent, token:Object = null):void {
            trace(event.fault.message);
            if (onFault != null) {
                onFault(event.fault.message, token);
            }
        }

    }
}